#include<bits/stdc++.h>
using namespace std;

int main()
{
    int x, c;
    cin >> x >> c;
    cout << x / (1000 + c) * 1000;
    return 0;
}